import { setToken, http } from '@/utils'
// 登录
export const login = (mobile, code) => {
    return async dispatch => {
        const res = await http.post('/authorizations', {
            mobile,
            code,
        })

        // 注意：此处获取的是 token 不是 refresh_token
        const { token } = res.data.data
        dispatch({ type: 'login/token', payload: token })
        setToken(token)
    }
}
